package com.jzh.selfwallpaper.application;

import android.app.Application;
import android.content.Context;
import android.view.WindowManager;

import imageloader.libin.com.images.loader.ImageLoader;

public class MyApplication extends Application {

    public static int SCREEN_WIDTH;

    public static int SCREEN_HEIGHT;

    @Override
    public void onCreate() {
        super.onCreate();
        WindowManager manager = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE);
        SCREEN_WIDTH  = manager.getDefaultDisplay().getWidth();
        SCREEN_HEIGHT= manager.getDefaultDisplay().getHeight();
        ImageLoader.init(getApplicationContext());
    }

    @Override
    public void onTrimMemory(int level) {
        super.onTrimMemory(level);
        ImageLoader.trimMemory(level);
    }

    @Override
    public void onLowMemory() {
        super.onLowMemory();
        ImageLoader.clearAllMemoryCaches();
    }
}
